{% extends 'layout.html' %}

{% block content %}
    <div class="row">
        <div class="col-md-12">
            <div class="box">
                <div class="box-header with-border">
                    <h3 class="box-title">查看机房</h3>

                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-box-tool" data-widget="collapse"><i
                                class="fa fa-chevron-up"></i>
                        </button>
                        <div class="btn-group">
                            <button type="button" class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown">
                                <i class="fa fa-wrench"></i></button>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="#">Action</a></li>
                                <li><a href="#">Another action</a></li>
                                <li><a href="#">Something else here</a></li>
                                <li class="divider"></li>
                                <li><a href="#">Separated link</a></li>
                            </ul>
                        </div>
                        <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i>
                        </button>
                    </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                    <div class="col-sm-10">
                        <form id="idc_form" method="post" class="form-horizontal">
                            <div class="form-group">
                                <label class="control-label col-sm-2">机房名称<span class="text-red">*</span>：</label>
                                <div class="col-sm-8">
                                    {{ idc_form.name }}
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="control-label col-sm-2">机房带宽：</label>
                                <div class="col-sm-8">
                                    {{ idc_form.bandwidth }}
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="control-label col-sm-2">运营商：</label>
                                <div class="col-sm-8">
                                    {{ idc_form.operator }}
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="control-label col-sm-2">联系人：</label>
                                <div class="col-sm-8">
                                    {{ idc_form.contacts }}
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="control-label col-sm-2">联系电话：</label>
                                <div class="col-sm-8">
                                    {{ idc_form.phone }}
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="control-label col-sm-2">地址：</label>
                                <div class="col-sm-8">
                                    {{ idc_form.address }}
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="control-label col-sm-2">网段：</label>
                                <div class="col-sm-8">
                                    {{ idc_form.network }}
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="control-label col-sm-2">注释：</label>
                                <div class="col-sm-8">
                                    {{ idc_form.comment }}
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button id="submit_button" class="btn btn-default" type="submit">保存</button>
                                    <a href="javascript:history.go(-1)" class="btn btn-white">取消</a>
                                    <!--<button class="btn btn-white" type="submit">取消</button>-->
                                </div>
                            </div>
                        </form>
                    </div>
                    <!-- /.row -->
                </div>
                <!-- ./box-body -->
            </div>
            <!-- /.box -->
        </div>
        <!-- /.col -->
    </div>
{% endblock %}
{% block self_footer_js %}
    <script>
        $('#idc_form').validator({
            timely: 2,
            theme: "yellow_right_effect",
            stopOnError: true,
            fields: {
                "name": {
                    rule: "required",
                    tip: "机房名",
                    ok: "",
                    msg: {required: "必须填写"}
                }
            },
            valid: function (form) {
                form.submit();
            }
        });
    </script>
{% endblock %}